//
//  DockView.m
//  Doc Ebook
//
//  Created by Hai Nguyen on 9/15/12.
//  Copyright (c) 2012 Hai Nguyen. All rights reserved.
//

#import "DockView.h"

@implementation DockView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (IBAction)pressMe:(id)sender{
	UIButton *button = (UIButton*)sender;
	[self.delegate pressButtonAtIndex:button.tag selected:button.state inDock:self];
	button.selected = YES;
	switch (button.tag) {
		case 1:
			libButton.selected = NO;
			favButton.selected = NO;
			settingButton.selected = NO;
			break;
		case 2:
			newsButon.selected = NO;
			favButton.selected = NO;
			settingButton.selected = NO;
			break;
		case 3:
			libButton.selected = NO;
			newsButon.selected = NO;
			settingButton.selected = NO;
			break;
		case 4:
			libButton.selected = NO;
			favButton.selected = NO;
			newsButon.selected = NO;
			break;
	}
}

- (IBAction)lock:(id)sender{
	lockButton.selected = !lockButton.selected;
	BOOL select = lockButton.selected;
	[self.delegate lockButtonPress:self selected:select];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
